﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using Microsoft.MSE.Catalog.Module.Configuration;
//using Microsoft.Uddi;
//using Microsoft.Uddi.TModels;
//using Microsoft.Uddi.Businesses;
//using Microsoft.Uddi.Services;
using Microsoft.MSE.Catalog.Contracts;

namespace Microsoft.MSE.Catalog.Module
{
    public interface IUddiPublisher : IDisposable
    {
        Endpoint PublishEndpointToUddi(Endpoint endPoint, RuntimeServer runtimeServer);

        Endpoint UpdateEndpointToUddi(Endpoint endPoint, RuntimeServer runtimeServer);

        void RemoveEndpointFromUddi(Endpoint endPoint, RuntimeServer runtimeServer);

    }

    public static class UddiPublisherFactory
    {

        public static IUddiPublisher GetUddiPublisher(ServiceCatalogUddi config)
        {
            IUddiPublisher uddiPublisher = null;
            switch (config.UddiVersion)
            {
                case 3:
                    uddiPublisher = new UddiPublisher30(config);
                    break; 
                default:
                    uddiPublisher = new UddiPublisher(config);
                    break;
            }

            return uddiPublisher;
        }
    }
}
